package com.ruoyi.trainingManagement.domain;


import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;


/**
 * 课程学生信息对象 course_student_info
 *
 * @author chenxl
 * @date 2025-06-18
 */
public class CourseStudentInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private String id;

    /** 关联课程班ID */
    @Excel(name = "关联课程班ID")
    private String courseScheduleDetailsId;

    @TableField(exist = false)
    private String currentCourseScheduleDetailsId;

    /** 学生ID */
    @Excel(name = "学生ID")
    private String studentId;

    /** 选课状态 (0=待审核, 1=已选课, 2=已退课) */
    @Excel(name = "选课状态 (0=待审核, 1=已选课, 2=已退课)")
    private Long enrollmentStatus;

    /** 选课时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "选课时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date enrollmentTime;

    /** 退课时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "退课时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date withdrawalTime;

    /** 平时成绩 */
    @Excel(name = "平时成绩")
    private BigDecimal attendanceScore;

    /** 考试成绩 */
    @Excel(name = "考试成绩")
    private BigDecimal examScore;

    // ========== 新增成绩字段 ==========
    /** 实验成绩 */
    @Excel(name = "实验成绩")
    private BigDecimal experimentScore;

    /** 期中成绩 */
    @Excel(name = "期中成绩")
    private BigDecimal midtermScore;

    /** 课程设计成绩 */
    @Excel(name = "课程设计成绩")
    private BigDecimal courseDesignScore;

    /** 其他成绩 */
    @Excel(name = "其他成绩")
    private BigDecimal otherScore;
    // =================================

    /** 总成绩 */
    @Excel(name = "总成绩")
    private BigDecimal totalScore;

    /** 是否及格 */
    @Excel(name = "是否及格")
    private Integer isPassed;

    /** 记录创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 记录更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    // ========== 原有新增字段：补考成绩、绩点 ==========
    /** 补考成绩 */
    @Excel(name = "补考成绩")
    private BigDecimal resitScore;

    /** 绩点 */
    @Excel(name = "绩点")
    private BigDecimal gradePoint;
    // ============================================


    public void setId(String id)
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }

    public void setCourseScheduleDetailsId(String courseScheduleDetailsId)
    {
        this.courseScheduleDetailsId = courseScheduleDetailsId;
    }

    public String getCourseScheduleDetailsId()
    {
        return courseScheduleDetailsId;
    }

    public void setStudentId(String studentId)
    {
        this.studentId = studentId;
    }

    public String getStudentId()
    {
        return studentId;
    }

    public void setEnrollmentStatus(Long enrollmentStatus)
    {
        this.enrollmentStatus = enrollmentStatus;
    }

    public Long getEnrollmentStatus()
    {
        return enrollmentStatus;
    }

    public void setEnrollmentTime(Date enrollmentTime)
    {
        this.enrollmentTime = enrollmentTime;
    }

    public Date getEnrollmentTime()
    {
        return enrollmentTime;
    }

    public void setWithdrawalTime(Date withdrawalTime)
    {
        this.withdrawalTime = withdrawalTime;
    }

    public Date getWithdrawalTime()
    {
        return withdrawalTime;
    }

    public void setAttendanceScore(BigDecimal attendanceScore)
    {
        this.attendanceScore = attendanceScore;
    }

    public BigDecimal getAttendanceScore()
    {
        return attendanceScore;
    }
    // 添加别名方法，供反射调用
    public BigDecimal getRegularScore() {
        return getAttendanceScore(); // 直接返回实际属性值
    }

    public void setExamScore(BigDecimal examScore)
    {
        this.examScore = examScore;
    }

    public BigDecimal getExamScore()
    {
        return examScore;
    }

    // ========== 新增成绩字段的 Getter/Setter ==========
    public BigDecimal getExperimentScore() {
        return experimentScore;
    }

    public void setExperimentScore(BigDecimal experimentScore) {
        this.experimentScore = experimentScore;
    }

    public BigDecimal getMidtermScore() {
        return midtermScore;
    }

    public void setMidtermScore(BigDecimal midtermScore) {
        this.midtermScore = midtermScore;
    }

    public BigDecimal getCourseDesignScore() {
        return courseDesignScore;
    }

    public void setCourseDesignScore(BigDecimal courseDesignScore) {
        this.courseDesignScore = courseDesignScore;
    }

    public BigDecimal getOtherScore() {
        return otherScore;
    }

    public void setOtherScore(BigDecimal otherScore) {
        this.otherScore = otherScore;
    }
    // ==============================================

    public void setTotalScore(BigDecimal totalScore)
    {
        this.totalScore = totalScore;
    }

    public BigDecimal getTotalScore()
    {
        return totalScore;
    }

    public void setIsPassed(Integer isPassed)
    {
        this.isPassed = isPassed;
    }

    public Integer getIsPassed()
    {
        return isPassed;
    }

    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }

    // ========== 原有新增字段的 Getter/Setter ==========
    public BigDecimal getResitScore() {
        return resitScore;
    }

    public void setResitScore(BigDecimal resitScore) {
        this.resitScore = resitScore;
    }

    public BigDecimal getGradePoint() {
        return gradePoint;
    }

    public void setGradePoint(BigDecimal gradePoint) {
        this.gradePoint = gradePoint;
    }
    // ==============================================


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("courseScheduleDetailsId", getCourseScheduleDetailsId())
                .append("studentId", getStudentId())
                .append("enrollmentStatus", getEnrollmentStatus())
                .append("enrollmentTime", getEnrollmentTime())
                .append("withdrawalTime", getWithdrawalTime())
                .append("attendanceScore", getAttendanceScore())
                .append("examScore", getExamScore())
                // 新增成绩字段的toString输出
                .append("experimentScore", getExperimentScore())
                .append("midtermScore", getMidtermScore())
                .append("courseDesignScore", getCourseDesignScore())
                .append("otherScore", getOtherScore())
                // 原有字段
                .append("totalScore", getTotalScore())
                .append("isPassed", getIsPassed())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("resitScore", getResitScore())
                .append("gradePoint", getGradePoint())
                .toString();
    }

    public String getCurrentCourseScheduleDetailsId() {
        return currentCourseScheduleDetailsId;
    }

    public void setCurrentCourseScheduleDetailsId(String currentCourseScheduleDetailsId) {
        this.currentCourseScheduleDetailsId = currentCourseScheduleDetailsId;
    }
}
